using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;

namespace Publish.Shell
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);

            //Application.Run(new Publish());
            //MessageBox.Show("标题", "内容",  ButtonState);

            Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Publish.Shell.Publish.exe");
            byte[] buffer = new byte[manifestResourceStream.Length];
            manifestResourceStream.Read(buffer, 0, ((int)manifestResourceStream.Length) - 1);
            Assembly.Load(buffer).EntryPoint.Invoke(null, null);


            //sr = Assembly.GetExecutingAssembly().GetManifestResourceStream("Publish.Shell.Publish.Update.exe");
            //fileBytes = new byte[sr.Length];
            //sr.Read(fileBytes, 0, (int)sr.Length - 1);
            //assembly = Assembly.Load(fileBytes);
            //mi = assembly.EntryPoint;
            //mi.Invoke(null, null);

            //Stream sr1 = Assembly.GetExecutingAssembly().GetManifestResourceStream("Publish.Shell.Publish.Update.exe");
            //byte[] fileBytes1 = new byte[sr1.Length];
            //sr1.Read(fileBytes1, 0, (int)sr1.Length - 1);
            //Assembly assembly1 = Assembly.Load(fileBytes1);
            //MethodInfo mi1 = assembly1.EntryPoint;
            //mi1.Invoke(null, null);
        }
    }
}
